using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace NetworkPower.DataModel.Models.Mapping
{
    public class DeviceMap : EntityTypeConfiguration<Device>
    {
        public DeviceMap()
        {
            // Primary Key
            this.HasKey(t => t.DeviceID);

            // Properties
            this.Property(t => t.DeviceName)
                .HasMaxLength(250);

            this.Property(t => t.DeviceType)
                .HasMaxLength(250);

            // Table & Column Mappings
            this.ToTable("Devices");
            this.Property(t => t.DeviceID).HasColumnName("DeviceID");
            this.Property(t => t.DeviceName).HasColumnName("DeviceName");
            this.Property(t => t.DeviceType).HasColumnName("DeviceType");
            this.Property(t => t.LoopLineIds).HasColumnName("LoopLineIds");
            this.Property(t => t.EquipmentId).HasColumnName("EquipmentId");
        }
    }
}
